<%= render :partial => "page_nav" %>


<h3 style="border-bottom:1px solid #ccc;padding:5px"><%= _('Comments on') %><%= link_to @article.title, { :action => 'edit', :id => @article }, :style => 'border:none' %> <span class="right"><%= @article.published? ? link_to(image_tag('/images/mephisto/icons/24-zoom-in.png', :style => 'vertical-align: middle'), @article.full_permalink, :style => 'border:none;') : '&nbsp;' %></span></h3>

<ul class="pagelist commentlist">
  <% if @comments.any? %>
  <% @comments.reverse.each_with_index do |comment, i| -%>
  <li class="event-comment<%= " shade" if (i % 2 > 0) %>" id="comment-<%= comment.id %>">
    <% if false %>
    <input type="checkbox" title="" />
    <% end %>
    <a name="comment-<%= comment.id %>"></a> 
    <% unless comment.body.blank? -%>
    <blockquote><p>"<%= strip_tags(comment.body) %>"</p></blockquote>
    <% end -%>
    <span class="meta">
      <cite>&mdash; <%= author_link_for comment %><%= %( (#{comment.author_email})) unless comment.author_email.blank? %> said <%=  time_ago_in_words comment.created_at %> ago</cite>
      
    <% if comment.approved? -%>
      <%= link_to_remote _('Unapprove'), :url => { :action => 'unapprove',       :id => @article, :comment => comment } %> | 
    <% else -%>
      <%= link_to_remote _('Approve'),   :url => { :action => 'approve',         :id => @article, :comment => comment } %> | 
    <% end -%>
      <%= link_to_remote _('Delete'),    :url => { :action => 'destroy_comment', :id => @article, :comment => comment } %>
    </span>
  </li>
  <% end -%>
  <% else %>
    <li class="event-none shade">This article has no <%= params[:filter].to_s.humanize.downcase %> comments.</li>
  <% end %>
</ul>


<% content_for :sidebar do %>
  <% if @articles.size > 1 -%>
  <div class="sgroup">
    <h3><%= _('Comments awaiting your approval') %></h3>
    <ul class="slist">
    <% @articles.each do |article, count| -%>
    <% if article.title != @article.title -%>
      <li><%= link_to "<strong>(#{count})</strong> #{h(article.title)}", :controller => 'articles', :action => 'comments', :id => article.id, :filter => :unapproved %></li>
    <% end -%>
    <% end -%>
    </ul>
  </div>
  <% end -%>
<% end %>


<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
  var comment = $(document.location.hash.substring(1));
  if(comment) Element.addClassName(comment, 'focused');
  
// ]]>
</script>